package com.yykj.hospital.server.converter;

import com.yykj.hospital.server.dto.banci.DoctorVisitLevelDTO;
import com.yykj.hospital.server.model.entity.banci.HospitalDoctorVisitLevel;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

public class DoctorVisitLevelDTOConverter {
    public static DoctorVisitLevelDTO convert(HospitalDoctorVisitLevel item){
        DoctorVisitLevelDTO dto = new DoctorVisitLevelDTO();
        BeanUtils.copyProperties(item,dto);
        return dto;
    }

    public static List<DoctorVisitLevelDTO> convert(List<HospitalDoctorVisitLevel> list){
        return list.stream().map(DoctorVisitLevelDTOConverter::convert).collect(Collectors.toList());
    }
}
